import { defineMongooseModel } from "#nuxt/mongoose";
export interface LogDataProps {
  action: string;
  createdAt: string;
  operator: string;
  account: string;
}
export const LogSchema = defineMongooseModel<LogDataProps>(
  "Log",
  {
    action: { type: String },
    operator: { type: String },
    account: { type: String },
  },
  {
    timestamps: true,
    toJSON: {
      // 过滤掉敏感字段
      transform(doc: any, ret: Record<string, any>, options: any) {
        delete ret.__v;
      },
    },
  }
);
